package com.party.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 
 * @author Caizhf
 * @date 2017年5月12日下午9:22:54
 * @version v.0.1
 * @email 1115054416@qq.com 
 * <p>Description:帖子</p>
 *
 */
public class Topic implements Serializable{
	
	private int tid;
	private Date topic_time;				//发帖时间
	private String topic_content;			//发帖内容
	private String topic_like;				//点赞
	private String topic_title;				//帖子标题
	private User user;						//发帖用户
	private List<Reply> replys;				//这个帖子的所有回复
	
	public int getTid() {
		return tid;
	}
	public void setTid(int tid) {
		this.tid = tid;
	}
	public Date getTopic_time() {
		return topic_time;
	}
	public void setTopic_time(Date topic_time) {
		this.topic_time = topic_time;
	}
	public String getTopic_content() {
		return topic_content;
	}
	public void setTopic_content(String topic_content) {
		this.topic_content = topic_content;
	}
	public String getTopic_like() {
		return topic_like;
	}
	public void setTopic_like(String topic_like) {
		this.topic_like = topic_like;
	}
	public String getTopic_title() {
		return topic_title;
	}
	public void setTopic_title(String topic_title) {
		this.topic_title = topic_title;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	public List<Reply> getReplys() {
		return replys;
	}
	public void setReplys(List<Reply> replys) {
		this.replys = replys;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + tid;
		result = prime * result + ((topic_content == null) ? 0 : topic_content.hashCode());
		result = prime * result + ((topic_like == null) ? 0 : topic_like.hashCode());
		result = prime * result + ((topic_time == null) ? 0 : topic_time.hashCode());
		result = prime * result + ((topic_title == null) ? 0 : topic_title.hashCode());
		return result;
	}
	
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Topic other = (Topic) obj;
		if (tid != other.tid)
			return false;
		if (topic_content == null) {
			if (other.topic_content != null)
				return false;
		} else if (!topic_content.equals(other.topic_content))
			return false;
		if (topic_like == null) {
			if (other.topic_like != null)
				return false;
		} else if (!topic_like.equals(other.topic_like))
			return false;
		if (topic_time == null) {
			if (other.topic_time != null)
				return false;
		} else if (!topic_time.equals(other.topic_time))
			return false;
		if (topic_title == null) {
			if (other.topic_title != null)
				return false;
		} else if (!topic_title.equals(other.topic_title))
			return false;
		return true;
	}
	
	
}
